package com.paranoid.controller;


import com.paranoid.entity.User;
import com.paranoid.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 *
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    @RequestMapping("/login")
    public Result login(User user){
        user = userService.login(user);
        if (user == null) {
            System.out.println(user);
            return Result.error("-1","用户名或密码错误");
        }
        System.out.println(user);
        System.out.println("成功");
        return Result.success();
    }
}
